/**
  ******************************************************************************
  * @file    lcd.h
  * @author  Qilong Huang
  * @version V0.0.1
  * @date    04-03-2020
  * @brief   This file contains functions to initialize the OS.  
  *				 
  *          
  ******************************************************************************
  * @attention
  *
  * <h2><center>&copy; KION(SZ) R&D Center
  *
  * Licensed under KION, (the "License");
  *
  ******************************************************************************
  */

/* Includes ------------------------------------------------------------------*/

#ifndef __LCD_H__
#define __LCD_H__
/*================================================[ public includes  ]================================================*/
#include "stm32f10x.h"
#include "global.h"
#include "top.h"
/*================================================[ public defines   ]================================================*/

#define LCDRSTport          GPIOB
#define LCD_RST             GPIO_Pin_5          //actlo - must be low for LCD to respond

#define LCDCS1port          GPIOB
#define LCD_CS1             GPIO_Pin_7          //actlo - must be low for LCD to respond

#define LCDCS2port          GPIOC
#define LCD_CS2             GPIO_Pin_0          //actlo - must be low for LCD to respond

#define LCDDIport           GPIOC
#define LCD_DI              GPIO_Pin_1          //high data, low  instruction,high data

#define LCDRWport           GPIOC
#define LCD_RW              GPIO_Pin_2          //high read, low write,high read

#define LCDEport            GPIOC
#define LCD_E               GPIO_Pin_3          //enable, high enable, low disable

#define LCDRSTport          GPIOB
#define LCD_RST             GPIO_Pin_5          //high, take outof reset


#define LCDDataPort         GPIOA               //PA.0-PA.7 used as LCD data bus

#define LCDBkport           GPIOB
#define LCD_Bk              GPIO_Pin_6

#define HIDE_ENABLE   1				//display the character
#define HIDE_DISABLE  0				//hide the character

typedef enum
{
	Black,
	White
} FillColor;

extern U8 OLED_GRAM[8][128];
/*================================================[ public functions ]================================================*/
extern void LCD_delay(u16 NWT);
extern void LCD_WriteCommand1(u8 cmd);
extern void LCD_WriteCommand2(u8 cmd);
extern void LCD_WriteData1(u8 data);
extern void LCD_WriteData2(u8 data);
extern void test_pattern(void);
extern void LCD_refresh(void);
extern void LCD_draw_point(U16 x_pos, U16 y_pos, U8 data);
extern void LCD_draw_line(S16 start_pt_x, S16 start_pt_y, S16 end_pt_x, S16 end_pt_y);
extern void LCD_draw_Empty_circle( S16 circle_center__pos_x, S16 circle_center__pos_y, S16 radious);
extern void LCD_draw_Fill_circle( S16 circle_center__pos_x, S16 circle_center__pos_y, S16 radious);
extern void LCD_draw_circle( S16 circle_center__pos_x, S16 circle_center__pos_y, S16 radious, FillColor color);
extern void LCD_draw_rectangle( S16 start_pt_x, S16 start_pt_y, S16 x_size, S16 y_size, FillColor color, U8 is_hide);
extern void LCD_draw_number( S16 start_row, S16 start_column, font_size size, int number, U8 is_hide);
extern void LCD_draw_upperchar( S16 start_row, S16 start_column, font_size size, char character, U8 is_hide);
extern void LCD_draw_lowerchar( S16 start_row, S16 start_column, font_size size, char character, U8 is_hide);
extern void LCD_init(void);
extern void LCD_draw_sign( S16 start_row, S16 start_column, font_size size, int sign);
extern void LCD_ersea_area( S16 start_pt_x, S16 start_pt_y, S16 x_size, S16 y_size);
extern void LCD_draw_scrollbar(U8 is_hide1, U8 is_hide2, U8 is_hide3, U8 is_hide4);
extern void LCD_draw_errorcode( S16 start_row, S16 start_column, U16 err_code, U8 is_hide);
/***********************************************************************************************************************
*                             Copyright 2016 Linde Material Handling. All rights reserved.                             *
***********************************************************************************************************************/


#endif
